<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<s:include value="/commun/header.jsp" />

<div id="body">

<ul>
<s:iterator value="agents" status="status">
<s:if test="%{#session.role=='admin' || (#session.role=='agent' && #session.rid==id)}">
<li>
	<s:property value="nom" /> <s:property value="prenom" />
	<s:url id="update" action="setupForNewUpdateAgent"><s:param name="agent.id" value="id"/></s:url>
		<s:a href="%{update}">Modifier</s:a>
		<s:if test="%{#session.role=='admin'}">
	<s:url id="deleteAgent" action="deleteAgent"><s:param name="agent.id" value="id"/></s:url><s:a href="%{deleteAgent}">Supprimer</s:a>
	</s:if>
</li>
</s:if>
</s:iterator>
</ul>

<p>
<s:url id="newAgent" action="setupForNewUpdateAgent"></s:url>
<s:a href="%{newAgent}">Ajouter un agent</s:a>
</p>
</div>
<s:include value="/commun/footer.jsp" />